/*
 * @Author: your name
 * @Date: 2020-06-12 14:50:47
 * @LastEditTime: 2020-06-19 08:43:39
 * @LastEditors: Please set LastEditors
 * @Description: 选项组件
 * @FilePath: \man_demo\assets\Script\Option\option.ts
 */ 

const {ccclass, property} = cc._decorator;

@ccclass
export class Option extends cc.Component {

    @property(cc.Node)
    public goods: cc.Node = null;       // 物品精灵
    @property(cc.Node)
    public skin: cc.Node = null;        // 物品额外皮肤
    @property(cc.Node)
    public check: cc.Node = null;       // 选择框

    public index: number = 0;           // 该选项所属分类
    public ownerSf: cc.SpriteFrame = null;   // 自身的sf
    public ownerSkin: cc.SpriteFrame = null; // 自身的皮肤
    public categoryName: string = null;          // 分类名称

    /**
     * @description: 初始化option上的数据
     * @param 
     * @return: 
     */
    public initOption(index:number, ownerSf:cc.SpriteFrame, ownerSkin:cc.SpriteFrame, categoryName) {
        this.index = index;
        this.ownerSf = ownerSf;
        this.ownerSkin = ownerSkin;
        this.categoryName = categoryName;
    }
}